﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MemberManager.ascx.cs" Inherits="Web.Cms.Member.MemberManager" %>
<%@ Import Namespace="Module.BusinessLogic" %>
<%@ Register src="../AjaxCP/Paging.ascx" tagname="Paging" tagprefix="uc1" %>

<script type="text/javascript">
    $(function () {
        $("#<%=txtDatefrom.ClientID %>").datepicker({ showOn: 'button', buttonImage: '/App_Themes/Default/Images/calendar_red.gif', buttonImageOnly: true, dateFormat: "dd/mm/yy", changeMonth: true, changeYear: true });
        $("#<%=txtDateTo.ClientID %>").datepicker({ showOn: 'button', buttonImage: '/App_Themes/Default/Images/calendar_red.gif', buttonImageOnly: true, dateFormat: "dd/mm/yy", changeMonth: true, changeYear: true });
    });
</script>
<div class="rows">
    <div class="fl width100 title-text"> <strong>Tên đăng nhập</strong></div>
    <div class="fl"><asp:TextBox ID="txtKeysearch" runat="server" Height="24px" CssClass="textbox-title"></asp:TextBox></div>    
</div>
<div class="cl5"></div>
<div>
    <div class="fl width100 title-text"> <b>Từ ngày</b></div>
    <div class="fl"><asp:TextBox ID="txtDatefrom" runat="server" Height="20px" Width="70"></asp:TextBox></div>
    <div class="fl title-text"><b>Đến ngày</b></div>
    <div class="fl"><asp:TextBox ID="txtDateTo" runat="server" Height="20px" Width="70"></asp:TextBox></div>    
</div>
<div class="cl5"></div>
<div style=" padding-left:50px;"><asp:Label Font-Bold="true" ForeColor="red" Font-Size="11px" ID="lblMessage" runat="server"></asp:Label></div>
<div class="cl5"></div>
<div class="rows">
    <div class="fl width70 title-text"></div>
    <div class="fl">
        <asp:Button runat="server" ID="btnTimKiem" CssClass="Button_Search" OnClick="btnTimKiem_Click"/>

    </div>
</div>
<div class="cl5"></div>
<p class="heading">Danh sách thành viên</p>
<div class="cl5"></div>
<asp:GridView ID="grdData" runat="server" SkinID="AdminGridView" 
    BackColor="White" AutoGenerateColumns="False" EnableModelValidation="True">
    <Columns>               
         <asp:BoundField HeaderText="STT">
            <ItemStyle HorizontalAlign="Center" Width="20px" />
            <HeaderStyle HorizontalAlign="Center" />
            <ItemStyle />
        </asp:BoundField>                   
         <asp:BoundField DataField="UserName" HeaderText="Tên đăng nhập" 
             HeaderStyle-Width="150" >
        
        <HeaderStyle Width="150px"></HeaderStyle>
         </asp:BoundField>
        
         <asp:TemplateField HeaderText="Địa chỉ" HeaderStyle-Width="200">
             <ItemTemplate>
               
                 <%#Eval("Address")%></a>
             </ItemTemplate>        
         </asp:TemplateField>
        
         <asp:BoundField DataField="PhoneNumber" HeaderText="Số điện thoại"  
             HeaderStyle-Width="100">        
        <HeaderStyle Width="100px"></HeaderStyle>
         </asp:BoundField>
        
         <asp:TemplateField HeaderText="Email" HeaderStyle-Width="150">
           <ItemTemplate>
             <%#Eval("Email")%>
           </ItemTemplate>
         
         </asp:TemplateField>
        
        <asp:TemplateField HeaderText="Ngày đăng ký">
            <ItemTemplate>    
            <%# Convert.ToDateTime(Eval("CreateOn")).ToString("dd/MM/yyyy HH:mm:ss")%>  
                                                                
            </ItemTemplate>
           <HeaderStyle Width="160px"></HeaderStyle> <ItemStyle HorizontalAlign="Center" />
        </asp:TemplateField>                  
         <asp:TemplateField HeaderText="Khách hàng của Fun88" HeaderStyle-Width="20" Visible="false">
            <ItemTemplate>
                <%#MemberBL.GetType1(Convert.ToBoolean(Eval("Type1").ToString()))%>  
            </ItemTemplate>
         </asp:TemplateField>
                      
         <asp:TemplateField HeaderText="Nhận khuyến mãi từ Fun88" HeaderStyle-Width="20" Visible="false">
            <ItemTemplate>
              <%#MemberBL.GetType2(Convert.ToBoolean(Eval("Type2").ToString()))%>  
            </ItemTemplate>
         </asp:TemplateField>
           <asp:TemplateField HeaderText="Cần tạo tài khoản Fun88" HeaderStyle-Width="20" Visible="false">
            <ItemTemplate>
              <%#MemberBL.GetType3(Convert.ToBoolean(Eval("Type3").ToString()))%>  
            </ItemTemplate>
         </asp:TemplateField>

         <asp:TemplateField HeaderText="Trạng thái">
             <ItemTemplate>
                <b style=" color:Blue;"> <%#MemberBL.GetActive(Convert.ToInt32(Eval("Active").ToString()))%></b>
             </ItemTemplate>
             <HeaderStyle Width="70px" />
         </asp:TemplateField>
        <asp:TemplateField HeaderText="Xóa" HeaderStyle-Width="20">
            <ItemTemplate>             
                <asp:Button ID="btnDelete" runat="server" CssClass="Icon_Delete" CommandArgument='<%# Eval("IdMember") %>' CommandName="Commanddelete" OnClientClick="return confirm('Bạn có chắc chắn xóa không')" />                   
            </ItemTemplate>

            <HeaderStyle Width="20px"></HeaderStyle>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
<div class="cl5"></div>
<p style="text-align:center;">
    &nbsp;<uc1:Paging ID="Paging1" runat="server" />